battman 2.2.1
battman


BATT-MAN Click

BATT-MAN Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : MikroE Team
  • Date : sep 2020.
  • Type : GPIO type

Software Support

Example Description

BATT-MAN Click is a very versatile battery operated power manager. When powered via mikroBUS, it will charge the connected Li-Ion/Li-Po 3.7V battery, while providing the output voltage on all its outputs at the same time.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.BattMan

Example Key Functions

Application Init

Initializes the Click driver and logger utility and enables the Click board.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
battman_init( &battman, &cfg );
battman_set_enable( &battman, 1 );
log_printf( &logger, "BATT-MAN Click enabled.\r\n" );
chg_flag = 0;
}
#define BATTMAN_MAP_MIKROBUS(cfg, mikrobus)
Definition battman.h:63
void application_init(void)
Definition main.c:40
#define MIKROBUS_POSITION_BATTMAN
Definition main.c:29

Application Task

Checks the charging indicator status, and in relation to its state it displays an appropriate message on USB UART.

void application_task ( void )
{
if ( !battman_get_charging_indicator ( &battman ) )
{
if ( chg_flag == 1 )
{
log_printf( &logger, "Charging enabled.\r\n" );
}
chg_flag = 0;
}
else
{
if ( chg_flag == 0 )
{
log_printf( &logger, "Charging disabled.\r\n" );
}
chg_flag = 1;
}
}
void application_task(void)
Definition main.c:69

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.